import {fetch} from '../fetch'
import config from "@/config/index"

class Article {
  constructor() {
  }

  static list(params) {
    return fetch({
      url: config.baseUrl.adminSys + '/article/list',
      method: 'post',
      params
    })
  }

  static detail(params) {
    return fetch({
      url: config.baseUrl.adminSys + '/article/detail',
      method: 'post',
      params
    })
  }

  static add(params) {
    return fetch({
      url: config.baseUrl.adminSys + '/article/add',
      method: 'put',
      params
    })
  }

  static update(params) {
    return fetch({
      url: config.baseUrl.adminSys + `/article/update/${params.id}`,
      method: 'post',
      params
    })
  }

  static delete(params) {
    return fetch({
      url: config.baseUrl.adminSys + `/article/delete/${params.id}`,
      method: 'delete',
      params
    })
  }

  static pv(params) {
    return fetch({
      url: config.baseUrl.adminSys + '/article/pv',
      method: 'post',
      params
    })
  }
}

export default Article
